﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace WNADEP.DataCenter.NetworkDataSet
{
    class RemoteData : INotifyPropertyChanged
    {
        #region Event
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion Event

        #region Private Methods
        private void Notify(string Name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(Name));
        }
        #endregion Private Methods

        #region Field
        string _SSID = "null";
        string _protocolType = "null";
        string _SIP = "null";
        string _SPort = "null";
        string _DIP = "null";
        string _DPort = "null";
        string _Protocol = "null";
        string _Flag = "null";
        bool _isEmergent = false;
        #endregion Field

        #region Binding Name
        public string SSID
        {
            get
            {
                return _SSID;
            }
            set
            {
                _SSID = value;
                Notify("SSID");
            }
        }

        public string ProtocolType
        {
            get
            {
                return _protocolType;
            }
            set
            {
                _protocolType = value;
                Notify("ProtocolType");
            }
        }

        public string SIP
        {
            get
            {
                return _SIP;
            }
            set
            {
                _SIP = value;
                Notify("SIP");
            }
        }

        public string SPort
        {
            get
            {
                return _SPort;
            }
            set
            {
                _SPort = value;
                Notify("SPort");
            }
        }

        public string DIP
        {
            get
            {
                return _DIP;
            }
            set
            {
                _DIP = value;
                Notify("DIP");
            }
        }

        public string DPort
        {
            get
            {
                return _DPort;
            }
            set
            {
                _DPort = value;
                Notify("DPort");
            }
        }

        public string Flag
        {
            get
            {
                return _Flag;
            }
            set
            {
                _Flag = value;
                Notify("Flag");
            }
        }

        public string Protocol
        {
            get
            {
                return _Protocol;
            }
            set
            {
                _Protocol = value;
                Notify("Protocol");
            }
        }

        public bool IsEmergent
        {
            get
            {
                return _isEmergent;
            }
            set
            {
                _isEmergent = value;
                Notify("IsEmergent");
            }
        }
        public string IsEmergentNotify
        {
            get
            {
                if (_isEmergent)
                    return "true";
                return "false";
            }
            set
            {
                //_isEmergent = value;
                Notify("IsEmergentNotify");
            }
        }
        #endregion Binding Name
    }
}
